<!--
static 关键字：
    static 在类内定义静态变量，这个变量不属于任何一个对象，只属于类，所以打印类对象时，不会显示static定义的变量

继承：
    在ES6是可以进行继承的
-->

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>

<script>
    class People{
        constructor(name,weight,height){
            this.name=name;
            this.weight=weight;
            this.height=height;
        }

        Say(){
            console.log(this.name+"nihao");
        }

        static other="other";
        static Sum(){
            return 100;
        }
    }

    let le=new People("le",98,168);
    console.log(le);
    le.Say();
    // le.Sum();    // 类对象无法调用类方法
    alert(People.other);
    alert(People.Sum());


    // 继承
    class Student extends People{
        constructor(name,height,weight,number){
            super(name,height,weight);
            this.number=number;
        }

        Say(){
            alert(this.name);
        }

    }
    
    let student=new Student("zhangsan",168,98,12);
    console.log(student);
    student.Say();

</script>
</html>